# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=zulucrypt
_pkgname=zuluCrypt
pkgver=7.1.0
pkgrel=1
pkgdesc='Front end to cryptsetup and tcplay and it allows easy management of encrypted block devices.'
groups=('blackarch' 'blackarch-crypto')
arch=('x86_64' 'aarch64')
url='https://github.com/mhogomchungu/zuluCrypt'
license=('GPL')
depends=('cryptsetup' 'qt5-base' 'libpwquality' 'libsecret' 'libxkbcommon-x11'
         'util-linux')
optdepends=('kwalletmanager: retrieve volume keys from kde kwallet')
conflicts=('zulucrypt-git')
makedepends=('cmake')
source=("https://github.com/mhogomchungu/zuluCrypt/releases/download/$pkgver/$_pkgname-$pkgver.tar.xz")
sha512sums=('d9d8dfb9e417ed803558a5c39a27f6888de00435c159570e333c51a86264cef74be415095fef036d65c64d50c1c1c558729865babbbc9c4f74101dae29a20feb')

build() {
  cd "$_pkgname-$pkgver"

  mkdir -p build
  cd build
  cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIB_SUFFIX=lib \
    -DNOGUI=false \
    -DQT5=true \
    -DHOMEMOUNTPREFIX=false \
    -DCMAKE_BUILD_TYPE=release \
    -DWITH_UUID=e2fs . ..
  make
}

package() {
  cp "$_pkgname-$pkgver/changelog" ../"${pkgname}.changelog"

  cd "$_pkgname-$pkgver/build"
  make DESTDIR="$pkgdir" install

  mkdir -p "$pkgdir/etc/modules-load.d"
  echo 'loop' > "$pkgdir/etc/modules-load.d/$pkgname.conf"
}

